import React, { Component } from 'react'
//类组件事件绑定 赋值变化 关注state
export default class Ok extends Component {
    state = { num: 666, count: 777 }
    change = (a) => { console.log(a); }
    changeCount = (num) => {
        this.setState({ num: num += 1 })
    }
    render() {
        const { num, count } = this.state
        return (
            <div>Ok__{count}
                <p>{num}</p>
                <button onClick={() => { this.change(4) }}>anniu</button>
                {/* <button onClick={this.change}>anniu</button> */}
                <button onClick={() => { this.changeCount(num) }}>an</button>

            </div>
        )
    }
}
